var f6={};
f6.$ = function(_id){
	return document.getElementById(_id);
};
//add one cookie
f6.addCookie= function (objName, objValue, objHours){
	var str = objName + "=" + escape(objValue)+"; path=/";
	
	//cookie will disappeared when web brower is closeed autocally.
	if(objHours > 0){
		var date = new Date();
		var ms = objHours*3600*1000;
		date.setTime(date.getTime() + ms);
		str += "; expires=" + date.toGMTString();
	}
	document.cookie = str;
	//window.alert("successed to add one cookie");
};

//to get one cookie by name.
f6.getCookie= function (objName){
	var arrStr = document.cookie.split("; ");
	for(var i = 0;i < arrStr.length;i ++){
		var temp = arrStr[i].split("=");
		if(temp[0] == objName) {
			return unescape(temp[1]);
		}
	} 
};

//to remove one cookie.
f6.delCookie= function (name){
	var date = new Date();
	date.setTime(date.getTime() - 10000);
	document.cookie = name + "=a; path=/; expires=" + date.toGMTString();
};

//to get all cookie message as a string.
f6.allCookie= function (){
	var str = document.cookie;
	if(str == ""){
		str = "no cookie";
	}
	//alert(str);
};



